﻿using System.ComponentModel;
using CodeAgent.Host.Context;
using Microsoft.SemanticKernel;

namespace CodeAgent.Host.Functions;

public class ChatFunction
{
    /// <summary>
    /// 通知用户任务完成
    /// </summary>
    [KernelFunction, Description("通知用户确认需求, 并等待用户确认")]
    public async Task<string> NotifyUserTask(
        [Description("对话内容")] string message
    )
    {
        if (AgentContext.Current?.ConfirmAction == null)
            return "用户未设置确认操作";

        return await AgentContext.Current!.ConfirmAction!.Invoke(message).ConfigureAwait(false);
    }
}